/* MessageBubble Styles */
.message-bubble-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-bubble-wrapper.user {
  flex-direction: row-reverse;
}

.message-bubble-avatar {
  flex-shrink: 0;
}

.message-bubble-content-wrapper {
  flex: 1;
  max-width: 90%;
  position: relative;
}

.message-bubble-wrapper.user .message-bubble-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 80%;
}

.message-bubble-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-bubble-wrapper.user .message-bubble-header {
  flex-direction: row-reverse;
}

.message-bubble-name {
  font-weight: 500;
  font-size: 14px;
}

.message-bubble-time {
  font-size: 12px;
}

.message-bubble-body {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 12px 16px;
  position: relative;
  word-wrap: break-word;
}

.message-bubble-wrapper.user .message-bubble-body {
  background: #e6f7ff;
}

.message-plain-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble-actions {
  position: absolute;
  top: 8px;
  right: -36px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message-bubble-wrapper:hover .message-bubble-actions {
  opacity: 1;
}

.message-bubble-wrapper.user .message-bubble-actions {
  right: auto;
  left: -36px;
}

.message-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.message-action-button:hover {
  background: #f0f0f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Edit mode styles */
.message-edit-area {
  width: 100%;
}

.message-edit-input {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
}

.message-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-save,
.btn-cancel {
  padding: 4px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-save {
  background: #1890ff;
  color: white;
  border-color: #1890ff;
}

.btn-save:hover {
  background: #40a9ff;
}

.btn-cancel {
  background: white;
}

.btn-cancel:hover {
  background: #f5f5f5;
}

/* Mobile Menu Item */
.mobile-menu-item {
  transition: background-color 0.2s;
}

.mobile-menu-item:active {
  background-color: #f5f5f5;
}

.mobile-menu-item.danger:active {
  background-color: #fff1f0;
}

/* Touch feedback */
.message-bubble-wrapper {
  -webkit-tap-highlight-color: transparent;
}

/* Mobile styles */
@media (max-width: 767px) {
  .message-bubble-wrapper {
    gap: 8px;
    margin-bottom: 16px;
  }

  .message-bubble-content-wrapper {
    max-width: 90%;
  }

  .message-bubble-wrapper.user .message-bubble-content-wrapper {
    max-width: 80%;
  }

  .message-bubble-body {
    padding: 12px 16px;
  }

  .message-bubble-body.mobile {
    padding: 12px 16px;
  }

  .message-bubble-actions {
    display: none;
  }

  .message-bubble-time {
    font-size: 10px !important;
  }
}